define(function(require,exports,module){
	var common = require('common');
	exports.add_to_car = function(){
		$(".add_to_car").live('click',function(){
			var data = {
				goods_id:$("input[name='goods_id']").val(),
				goods_num:$("input[name='goods_num']").val()
			}
			$.post(food_detail_var.foodAddToCarUrl,data,function(e){
				if(e.status){
					var cookData = common.getCookie("myCar");
					var cookArr = cookData.split(':');
					$(".user_car font").text(cookArr[1]);
					$.Zebra_Dialog(e.message, {
					    'type':'information',
					    'title':'成功',
					    'buttons':  ['确定'],
					    'onClose':  function() {
					    }
					});	   				
	   			}else{
					$.Zebra_Dialog(e.message, {
					    'type':'errot',
					    'title':'失败',
					    'buttons':  ['确定'],
					    'onClose':  function() {
					    }
					});	   				
	   			}
			},'json');
		})
	}
});